package com.atguigu.feign;

import com.atguigu.feign.fallback.ProductFeignClientFallback;
import com.atguigu.product.bean.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@FeignClient(value = "product",fallback = ProductFeignClientFallback.class)
public interface ProductFeignClient {
    // 如果是标注在controller中，是接受请求，如果是标注在接口上，是发送请求
    @GetMapping("/api/product/{id}")
    Product getProductById(@PathVariable("id") Long id);
}
